package com.itheima.mapper;


import com.itheima.entity.pojo.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author huangzelnag
 * @create 2022-05-04
 */
@Mapper
public interface CategoryMapper {

    /**
     * 查询是否存在相同的数据
     * @param category
     * @return
     */
    Integer selectByCategory(Category category);
    /**
     * 增加分类
     * @param category
     * @return
     */
    Integer insert(Category category);

    /**
     * 更新分类
     * @param category
     * @return
     */
    Integer update(Category category);

    /**
     * 根据id删除分类
     * @param id
     * @return
     */
    Integer deleteById(String id);

    List<Category> selectAll(Integer type);


    List<Category> selectAllPage(@Param("page") Integer page,@Param("pageSize") Integer pageSize);

    Integer selectCount();

    List<Category> selectList();
}
